<template>
    <div class="content">
        {{msg}}

        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="账户">
                <el-input v-model="form.account"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="form.pass"></el-input>
            </el-form-item>
        </el-form>
        <el-button @click="submit">提交</el-button>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                msg: '这是内容1111111',
                form:{
                    account:'',
                    pass:''
                }
            }
        },
        methods:{
            submit(){
                if(this.form.account!=''&&this.form.pass !=''){
                        this.$axios.login({username: this.form.account, loginPwd: this.form.pass}).then(res=>{
                            console.log('res----',res)
                            require('store').set('token',res.data.data.token);
                        }).catch(err=>{
                            console.log('err----',err)
                        })
                }
            }
        }

    }
</script>